using System.Collections;
using System.Collections.Generic;
using UnityEngine;

// 摄像机跟随
namespace PlatfromShoot
{
    public class CameraCtrl : MonoBehaviour
    {
        private Transform mTarget;

        private void Start() {
            mTarget = GameObject.FindGameObjectWithTag("Player").transform;  // 找到对象
        }

        private void LateUpdate() {
            // 逻辑更新全部结束后再去使用摄像机
            transform.localPosition = new Vector3(mTarget.position.x, mTarget.position.y, -10);
        }
    }
}
